package com.github.gaojh.example.filter;

import com.github.gaojh.ioc.annotation.WebFilter;
import com.github.gaojh.mvc.filter.Filter;
import com.github.gaojh.server.http.HttpContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author 高建华
 * @date 2019-04-16 20:52
 */
@WebFilter(pathPatterns = {"/**"}, ignorePathPatterns = {"/hello"}, order = 5)
public class DemoFilter implements Filter {
    private static Logger logger = LoggerFactory.getLogger(DemoFilter.class);


    @Override
    public boolean doBefore(HttpContext httpContext) throws Exception {
        logger.info("demo  dobefore");
        return true;
    }

    @Override
    public void doAfter(HttpContext httpContext) throws Exception {
        System.out.println("demo after");
    }
}
